#!/bin/ksh

input=$1
type=$2
langs=$3
langt=$4

tail1="</DOC>\n"
tail2="</${type}set>\n"

gawk 'BEGIN{
      printf("<'"${type}"'set setid=\"mt_scoring_kitv0-ref\" srclang=\"'"${langs}"'\" trglang=\"'"${langt}"'\">\n");\
      printf("<DOC docid=\"generic_testdoc\" sysid=\"at&t\">\n");\
      }\
      { printf("<seg>");\
	for(i=1;i<NF;i=i+1) printf("%s ",$i);\
	 printf("%s</seg>\n",$NF);\
       }
       END{
          printf("</DOC>\n");
	  printf("</'"${type}"'set>\n");
       }'         $input 
      
